package cn.kpi.service.usualassessment.impl;

import cn.kpi.dao.sys.UserDao;
import cn.kpi.dao.usualassessment.UserAudioDao;
import cn.kpi.entity.usualassessment.UserAudio;
import cn.kpi.service.usualassessment.IAudioUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: kpispis
 * @BelongsPackage: cn.kpi.service.usualassessment.impl
 * @Author: lizeze
 * @CreateTime: 2018-08-02 22:48
 * @Description: ${Description}
 */
@Service
public class AudioUSerServiceImpl implements IAudioUserService {


    @Autowired
    private UserAudioDao userAudioDao;

    @Override
    public List<UserAudio> getUserAduio(String where) {
        return userAudioDao.getAudios(where);
    }

    @Override
    public int addUserAudio(int userid, int audioid) {
        userAudioDao.deleteAudio(userid);

        return userAudioDao.addAudio(userid, audioid);
    }

    @Override
    public int deleteUserAusio(int userid) {
        return userAudioDao.deleteAudio(userid);
    }

    @Override
    public int deleteUserAusioById(int id) {
        return  userAudioDao.deleteAudioByid(id);
    }


}
